home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / programer2 / icon / Docs / Ipd115 < prev    next >
Text File  |  1990-07-19  |  8KB  |  463 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                  Benchmarking Version 8 of Icon
  11.  
  12.                         Ralph E. Griswold
  13.                Department of Computer Science, The
  14.                       University of Arizona
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.    Benchmarks of Icon programs provide interesting comparisons of
  22. the performance of different computer systems [1].
  23.  
  24.    A suite of representative Version 8 Icon programs has been
  25. assembled to provide uniform benchmarks over the range of comput-
  26. ers on which Icon has been implemented. Tools are provided so
  27. that testing is largely automatic.
  28.  
  29.    The benchmark programs do not require any ``optional''
  30. features, such as co-expressions, and they work with the same
  31. regions sizes on implementations of Icon with either fixed or
  32. expandable memory regions. Input and output normally are
  33. suppressed to avoid factors like disk speed from affecting the
  34. results.
  35.  
  36.    The benchmark programs, taken from the Icon program library
  37. [2], are:
  38.  
  39.      concord.icn Simple word concordance; string analysis and
  40.                  synthesis with table manipulation.
  41.  
  42.      deal.icn    Randomly selected bridge hands; string synthesis
  43.                  with mapping.
  44.  
  45.      ipxref.icn  Icon program cross reference; string analysis
  46.                  and synthesis with list manipulation.
  47.  
  48.      queens.icn: Solutions to the non-attacking n-queens problem;
  49.                  goal-directed evaluation and string synthesis.
  50.  
  51.      rsg.icn:    Random sentence generation; string synthesis
  52.                  with list and table manipulation.
  53.  
  54.    The procedures that are used to support benchmarking are
  55. listed in Appendix A.  A Makefile for running the benchmarks is
  56. listed in Appendix B.
  57.  
  58.    The benchmark suite is available in a variety of formats for
  59. different computer systems.  It includes a form for reporting
  60. results to the Icon Project [3].
  61.  
  62.  
  63.  
  64. IPD115b                       - 1 -                 March 8, 1990
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73. References
  74.  
  75.  
  76. 1.   R. E. Griswold and M. T. Griswold, Icon Newsletter 31, Nov.
  77.      1989.
  78.  
  79. 2.   R. E. Griswold, The Icon Program Library, The Univ. of
  80.      Arizona Tech. Rep. 90-7, 1990.
  81.  
  82. 3.   R. E. Griswold, Version 8 Icon Benchmark Report, The Univ.
  83.      of Arizona Icon Project Document IPD116, 1989.
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. IPD115b                       - 2 -                 March 8, 1990
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                    Appendix A - Support Procedures
  140.  
  141.  
  142. #################################################################
  143. #
  144. #  Support procedures for Icon benchmarking.
  145. #
  146. #################################################################
  147. #
  148. #     The code to be times is bracketed by calls to Init__(name)
  149. #  and Term__(), where name is used for tagging the results.
  150. #  The typical usage is:
  151. #
  152. #       procedure main()
  153. #          [declarations]
  154. #          Init__(name)
  155. #               .
  156. #               .
  157. #               .
  158. #          Term__()
  159. #       end
  160. #
  161. #     If the environment variable OUTPUT is set, program output is
  162. #  not suppressed.
  163. #
  164. #################################################################
  165.  
  166. global Save__, Saves__, Name__
  167.  
  168. # List information before running.
  169. #
  170. procedure Init__(prog)
  171.    Name__ := prog                       # program name
  172.    Signature__()                        # initial information
  173.    Regions__()
  174.    Time__()
  175.    if getenv("OUTPUT") then {   # if OUTPUT is set, allow output
  176.       write("*** Benchmarking with output ***")
  177.       return
  178.       }
  179.    Save__ := write                      # turn off output
  180.    Saves__ := writes
  181.    write := writes := 1
  182.    return
  183. end
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. IPD115b                       - 3 -                 March 8, 1990
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. # List information at termination.
  206.  
  207. procedure Term__()
  208.    if not getenv("OUTPUT") then {       # if OUTPUT is not set, restore output
  209.       write := Save__
  210.       writes := Saves__
  211.       }
  212.                                         # final information
  213.    write(Name__," elapsed time = ",Time__())
  214.    Regions__()
  215.    Storage__()
  216.    Collections__()
  217.    return
  218. end
  219.  
  220.  
  221. # List garbage collections performed.
  222. #
  223. procedure Collections__()
  224.    static labels
  225.    local collections
  226.  
  227.    initial labels := ["total","static","string","block"]
  228.  
  229.    collections := []
  230.    every put(collections,&collections)
  231.    write("collections")
  232.    every i := 1 to *labels do
  233.       write(labels[i],right(collections[i],8))
  234.    return
  235. end
  236.  
  237.  
  238. # List region sizes.
  239. #
  240. procedure Regions__()
  241.    static labels
  242.    local regions
  243.  
  244.    initial labels := ["static","string","block"]
  245.  
  246.    regions := []
  247.    every put(regions,®ions)
  248.    write("regions")
  249.    every i := 1 to *labels do
  250.       write(labels[i],right(regions[i],8))
  251.    return
  252. end
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. IPD115b                       - 4 -                 March 8, 1990
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. # List relveant implementation information
  272. #
  273. procedure Signature__()
  274.    write(&version)
  275.    write(&host)
  276.    every write(&features)
  277.    return
  278. end
  279.  
  280.  
  281. # List storage used.
  282. #
  283. procedure Storage__()
  284.    static labels
  285.    local storage
  286.  
  287.    initial labels := ["static","string","block"]
  288.  
  289.    storage := []
  290.    every put(storage,&storage)
  291.    write("storage")
  292.    every i := 1 to *labels do
  293.       write(labels[i],right(storage[i],8))
  294.    return
  295. end
  296.  
  297.  
  298. # List elapsed time.
  299. #
  300. procedure Time__()
  301.    static lasttime
  302.  
  303.    initial lasttime := &time
  304.    return &time - lasttime
  305. end
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. IPD115b                       - 5 -                 March 8, 1990
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.                 Appendix B - Makefile for Benchmarking
  338.  
  339.  
  340. ######################################################################
  341. #
  342. #  Makefile for Version 8 Icon benchmarking.
  343. #
  344. ######################################################################
  345. #
  346. #     In order for benchmark results to be compared meaningfully with
  347. #  those from other systems, the string and block regions must be set to
  348. #  65,000 bytes. This is the normal default.
  349. #
  350. #     To run the benchmarks, use
  351. #
  352. #       make benchmark
  353. #
  354. #  This creates .out files with benchmark results and lists the timings.
  355. #
  356. #     On systems where timing varies with load or other factors, use
  357. #
  358. #       make rerun
  359. #
  360. #  which reruns the benchmarks and appends the results to the .out files.
  361. #
  362. ######################################################################
  363. #
  364. #     Program output normally is suppressed. To get program output, set
  365. #  the environment variable OUTPUT.  The ``expected'' output (modulo
  366. #  timing differences), is in files .std for comparison.  (These files
  367. #  are not included with all disributions because of their large size.)
  368. #
  369. ######################################################################
  370.  
  371.  
  372. SHELL=/bin/sh
  373.  
  374.  
  375. what:
  376.                 @echo "What do you want to make?"
  377.  
  378.  
  379. benchmark:      # do the whole thing
  380.                 make translate compile run check
  381.  
  382.  
  383. translate:      # create ucode files for linking
  384.                 icont -s -c post
  385.                 icont -s -c options
  386.                 icont -s -c shuffle
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. IPD115b                       - 6 -                 March 8, 1990
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403. compile:        # compile the benchmark programs
  404.                 icont -s concord
  405.                 icont -s deal
  406.                 icont -s ipxref
  407.                 icont -s queens
  408.                 icont -s rsg
  409.  
  410.  
  411. run:            # run the programs
  412.                 echo Running concord ...
  413.                 iconx concord <concord.dat >concord.out
  414.                 echo Running deal ...
  415.                 iconx deal -h 500 >deal.out
  416.                 echo Running ipxref ...
  417.                 iconx ipxref <ipxref.icn >ipxref.out
  418.                 echo Running queens ...
  419.                 iconx queens -n9 >queens.out
  420.                 echo Running rsg ...
  421.                 iconx rsg <rsg.dat >rsg.out
  422.  
  423.  
  424. rerun:          # rerun the benchmarks
  425.                 echo Running concord ...
  426.                 iconx concord <concord.dat >>concord.out
  427.                 echo Running deal ...
  428.                 iconx dea -h 500 >>deal.out
  429.                 echo Running ipxref ...
  430.                 iconx ipxref <ipxref.icn >>ipxref.out
  431.                 echo Running queens ...
  432.                 iconx queens -n9 >>queens.out
  433.                 echo Running rsg ...
  434.                 iconx rsg <rsg.dat >>rsg.out
  435.  
  436.  
  437. check:
  438.                 grep elapsed *.out
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460. IPD115b                       - 7 -                 March 8, 1990
  461.  
  462.  
  463.